<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php include template('phpcms','header'); ?>
<script language="JavaScript">
function search_submit()
{
if($('#title').val() =="")
    {
$('#title').focus();
alert("请填写您要搜索的问题.");
return false;
}
document.wordform.action = '<?php echo $M['url'];?>search.php';
    document.wordform.keywords.value = document.wordform.title.value;
document.wordform.submit();
}
</script>
<!--begin main-->
<div id="main">
  <!--begin left-->
  <div id="main_l">
    <div id="position"><a href="">首页</a><a href="<?php echo $M['url'];?>">问吧</a> 搜索结果</div>
<div id="box_1" class="mar_10">
<form name="wordform" action="<?php echo $M['url'];?>question.php" method="get">
<input type="text" name="title" id="title" size="70" value="<?php echo $keywords;?>"/>
<input type="submit" value="我要提问" /> 
<input type="hidden" name="keywords" id="keywords"/>
<input type="button" value="搜索答案" name="search" onClick="search_submit();" />
</form>
      </div>
    <div class="tag_menu">
      <ul>
        <li <?php if($status==5 || !$status && !$flag) { ?>class="selected"<?php } ?>><a href="<?php echo $M['url'];?>search.php?status=5&keywords=<?php echo $keywords;?>">已解决的问题</a></li>
        <li <?php if($status==3) { ?>class="selected"<?php } ?>><a href="<?php echo $M['url'];?>search.php?status=3&keywords=<?php echo $keywords;?>">未解决的问题</a></li>
        <li <?php if($flag==1) { ?>class="selected"<?php } ?>><a href="<?php echo $M['url'];?>search.php?flag=1&keywords=<?php echo $keywords;?>">投票中的问题</a></li>
      </ul>
    </div>
<table cellpadding="0" cellspacing="0" class="table_list">
<tr>
<th>标题</th>
<th width="50">回答数</th>
<th width="80">提问者</th>
<th width="110">提问时间</th>
</tr>
<?php if(is_array($infos)) foreach($infos AS $n => $r) { ?>
<tr>
<td class="align_left">·<a href="<?php echo $M['url'];?>show.php?id=<?php echo $r['askid'];?>" target="<?php echo $target;?>"><?php echo $r['title'];?></a> <a href="<?php echo $CATEGORY[$r['catid']]['url'];?>" style="color:gray">[<?php echo $CATEGORY[$r['catid']]['catname'];?>]</a></td>
<td><?php echo $r['answercount'];?></td>
<td><a href="<?php echo space_url($r['userid']);?>" target="_blank"><?php echo $r['username'];?></a></td>
<td><?php echo date('Y-m-d H:i', $r[addtime]);?></td>
</tr>
<?php } ?>
</table>
<?php if($pages) { ?><p id="pages"><?php echo $pages;?></p><?php } ?>
  </div>
  <!--end left-->
  <!--begin right-->
  <div id="main_r">
    <h4>热点问题</h4>
    <div>
      <ul class="text_list">
       <?php echo tag('ask', 'tag_ask', "SELECT * FROM `zzinfo_ask` WHERE status='3'  ORDER BY hits DESC", 0, 10, array (  'catid' => '0',  'userid' => '',  'flag' => '-1',  'action' => $action,  'urlruleid' => '29',  'class' => 'url',  'target' => '_blank',  'showcatname' => '0',  'titlelen' => '46',));?>
      </ul>
    </div>
  </div>
  <!--end right-->
</div>
<!--end main-->
<!--begin foot-->
<?php include template('phpcms','footer'); ?>